package oop.java0324;

import java.util.Arrays;

public class Array {
    public static void main(String[] args) {
        int[] arr = new int[]{1, 2, 3, 4, 5};
        int left = 0;
        int right = arr.length - 1;
        while (left < right) {
            while (arr[left] % 2 == 0) {
                swap(arr, left, right);
                right--;

            }
            left++;
        }
        System.out.println(Arrays.toString(arr));


    }

    public static void swap(int[] arr, int i, int j) {
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }


}
